﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebForms/SiteWF.master" AutoEventWireup="true" CodeBehind="CustomerView.aspx.cs" Inherits="WaterfrontLodge.WebForms.CustomerView" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
  <legend>Search Customer</legend> 
    <table >
        <tr>
            <th align="right" >
                <asp:Label ID="Label1" runat="server" Text="Customer Name:"></asp:Label>
                <asp:TextBox ID="TxtUsername" runat="server"></asp:TextBox>
                <asp:Button ID="Search" runat="server" onclick="Search_Click" Text="Search" />
                <asp:Label ID="LblMassage" runat="server" ForeColor="#0033CC"></asp:Label>
            </th>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GdvCutomer" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataKeyNames="UserId" 
                    DataSourceID="EntityDataSourceCustomer" 
                    onselectedindexchanged="GdvCutomer_SelectedIndexChanged">
                    <Columns>
                        <asp:CommandField SelectText="Detail" ShowSelectButton="True" />
                        <asp:BoundField DataField="UserName" HeaderText="Customer Name" 
                            SortExpression="UserName" />
                        <asp:BoundField DataField="Address" HeaderText="Address" 
                            SortExpression="Address" />
                        <asp:BoundField DataField="Gender" HeaderText="Gender" 
                            SortExpression="Gender" />
                        <asp:BoundField DataField="IDNO" HeaderText="IC No." 
                            SortExpression="IDNO" />
                        <asp:BoundField DataField="TelephoneNO" HeaderText="Telephone No." 
                            SortExpression="TelephoneNO" />
                        <asp:BoundField DataField="Salutation" HeaderText="Occupation" 
                            SortExpression="Salutation" />
                    </Columns>
                    <SelectedRowStyle ForeColor="#FF9966" />
                </asp:GridView>
                <asp:EntityDataSource ID="EntityDataSourceCustomer" runat="server" 
                    ConnectionString="name=WaterFrontEntities" 
                    DefaultContainerName="WaterFrontEntities" EnableFlattening="False" 
                    EntitySetName="Customers" EntityTypeFilter="Customer">
                </asp:EntityDataSource>
            </td>
           
        </tr>
    </table>
     </fieldset>
</asp:Content>
